#include "Database.h"
#include "start.h"
#include "Exec.h"
#include "ParamManager.h"

#include <regex.h>
#pragma comment (lib, "regex.lib")

#ifndef _adComputer
#define _adComputer

class adComputer {
public:
	char netbios[DEFAULT_BUFLEN];
	char dn_curr[DEFAULT_BUFLEN];
	ParamManager *detail;
	int id;

	// Constructor
	adComputer(HANDLE /*mutex*/, int /*id*/, char* /*netbios*/, ParamManager* /*detail*/);
	
	// Deconstructor
	~adComputer();

	// dsquery to obtain the dn_curr
	bool updateDN();

	// Returns true if object exists, false if not
	bool isValid();

	// Returns a current status
	bool isEnabled();

	// if the object is stale over specified num of days (also sets dn_curr)
	bool isStale(int /*days*/);

	// if the object pings
	bool isPing();

	// if the object matches one of the provided exceptions
	Param* isException(ParamManager* /*exceptions*/);

	// move the object from dn_curr to specified location
	bool moveTo(HANDLE /*mutex*/, char* /*dest_dn*/);

	// disable this object
	bool disable(HANDLE /*mutex*/);

	// enable this object
	bool enable(HANDLE /*mutex*/);

	// sets a value in the database
	bool setBool(HANDLE /*mutex*/, char* /*data*/, bool /*value*/);
	bool setString(HANDLE /*mutex*/, char* /*data*/, char* /*value*/);

	//
	bool wasMoved(HANDLE /*mutex*/);

	// Logs the message to the database
	void log(HANDLE /*mutex*/, char* /*msg*/);
};

#endif	/* _adComputer */